package com.onesports.intelligent.k12.polarlight.service.course.manage;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.onesports.intelligent.k12.polarlight.domain.entity.course.CourseGuidePriceRel;
import com.onesports.intelligent.k12.polarlight.mapper.course.CourseGuidePriceRelMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author FPH
 * @since 2022年7月10日23:22:53
 */
@Service
public class CourseGuidePriceRelService extends ServiceImpl<CourseGuidePriceRelMapper, CourseGuidePriceRel> {
    /**
     * 删除course表所关联的排班级模板
     * @param courseId
     */
    public void removeByCourseId(String courseId){
       remove(new LambdaQueryWrapper<CourseGuidePriceRel>()
               .eq(CourseGuidePriceRel::getCourseId,courseId));
    }

    /**
     * 根据课程id获取指导价
     * @param courseIds 课程id集合
     * @return List<CourseGuidePriceRelVO>
     */
    public List<CourseGuidePriceRel> selectByCourseIds(List<String> courseIds) {
        return this.list(new LambdaQueryWrapper<CourseGuidePriceRel>().in(CourseGuidePriceRel::getCourseId,courseIds));
    }
}
